<div class="form form-horizontal">

<?php $form = $this->beginWidget('CActiveForm'); ?>
	
	<div class="alert alert-info">
        <a class="close" data-dismiss="alert">×</a>
        Fields with <span class="required">*</span> are required.
    </div><!-- /Form filling tips -->

	<?php echo CHtml::errorSummary(
		$model,
		'<a class="close" data-dismiss="alert">×</a><h4 class="alert-heading">Please fix the errors below:</h4>',
		'',
		array('class'=>'alert alert-error',)
	); ?><!-- /Form error summary -->

	<div class="control-group<?php echo ($form->error($model, 'title')) ? ' error' : ''; ?>">
		<?php echo $form->labelEx($model, 'title', array('class'=>'control-label')); ?>
		<div class="controls">
			<?php echo $form->textField($model, 'title', array('size'=>80, 'maxlength'=>128, 'class'=>'input-xxlarge')); ?>
			<?php echo $form->error($model, 'title', array('class'=>'help-inline')); ?>
		</div>
	</div>

	<div class="control-group<?php echo ($form->error($model, 'title')) ? ' error' : ''; ?>">
		<?php echo $form->labelEx($model, 'content', array('class'=>'control-label')); ?>
		<div class="controls">
			<?php $this->widget('application.extensions.tinymce.ETinyMce', array(
	            'name'=>'content',
	            'id'=>'content',
	            'model'=>$model,
	            'attribute'=>'content',
	        )); ?>
			<?php echo $form->error($model, 'content', array('class'=>'help-inline')); ?>
		</div>
	</div>

	<div class="control-group<?php echo ($form->error($model, 'tags')) ? ' error' : ''; ?>">
		<?php echo $form->labelEx($model, 'tags', array('class'=>'control-label')); ?>
		<div class="controls">
			<?php $this->widget('CAutoComplete', array(
				'model'=>$model,
				'attribute'=>'tags',
				'url'=>array('suggestTags'),
				'multiple'=>true,
				'htmlOptions'=>array('size'=>50, 'maxlength'=>128, 'class'=>'input-xlarge'),
			)); ?>
			<p class="help-block">Please separate different tags with commas.</p>
			<?php echo $form->error($model, 'tags', array('class'=>'help-inline')); ?>
		</div>
	</div>

	<div class="control-group<?php echo ($form->error($model, 'status')) ? ' error' : ''; ?>">
		<?php echo $form->labelEx($model, 'status', array('class'=>'control-label')); ?>
		<div class="controls">
			<?php echo $form->dropDownList($model, 'status', Lookup::items('PostStatus')); ?>
			<?php echo $form->error($model, 'status', array('class'=>'help-inline')); ?>
		</div>
	</div>

	<div class="form-actions">
		<?php echo CHtml::linkButton($model->isNewRecord ? 'Create' : 'Save', array('class'=>'btn btn-large btn-primary')); ?>
		<?php echo CHtml::link('Cancel', array('post/index'), array('class'=>'btn btn-large')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- /form -->